###############
## Makefile
###############

BIN=../bin/HttpServerBin

##ARCH = $(shell uname -m)	# ARCH becomes the output from the uname -m command.
CXX=/usr/bin/g++
CXXFLAGS=-g -O2 -std=c++11 $(INCS)
BOOST_ROOT=/home/dev/boost

SRCS= HttpServerMain.cpp \
      HttpServer.cpp \
      Connection.cpp \
      Header.cpp \

OBJS = $(patsubst %.cpp, %.o, $(SRCS))

INCS = -I../include \
       -I$(BOOST_ROOT)/include \

LIBS = \
        $(BOOST_ROOT)/lib/libboost_thread.a \
	$(BOOST_ROOT)/lib/libboost_system.a \
	

$(BIN): $(OBJS)
	$(CXX) -o $(BIN) $(OBJS) $(LIBS) -lpthread

all: $(BIN) run
	
run:
	@echo "----------------------------"
	@echo "Running the programme. "
	@echo "----------------------------"
	../bin/HttpServerBin
	@echo "----------------------------"

clean:
	rm -rf $(BIN) *.o
